package com.ykt.controller;

import com.jfinal.aop.Before;
import com.ykt.model.ClientVersion;
import com.ykt.service.ClientVersionService;
import com.ykt.validator.ClientValidator;
import com.ykt.vo.ResultVo;

/**
 * 商户版客户端升级
 *
 * @author long.hua
 * @version 1.0.0
 * @since 2016-02-15 23:16
 */
public class ClientVersionController extends BaseController{

    private ClientVersionService versionService = enhance(ClientVersionService.class.getName(), ClientVersionService.class);


    @Before(ClientValidator.class)
    public void update(){
        int versionCode = getParaToInt("versionCode", -1);

        ClientVersion clientVersion = versionService.findByVersionCode(versionCode, ClientVersion.Type.MERCHANT);

        this.returnJson(ResultVo.success(clientVersion));
    }


}
